﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QThread>
#include <QPushButton>
#include <QLabel>

class WorkerThread : public QThread {
    Q_OBJECT

public:
    WorkerThread(QObject *parent = nullptr) : QThread(parent) {}
    void run() override; // 线程执行的函数

signals:
    void resultReady(const QString &result);
};

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void startThread();
    void handleResults(const QString &result);

private:
    QPushButton *startButton;
    QLabel *statusLabel;
    WorkerThread *workerThread;
};
#endif // MAINWINDOW_H
